package com.ruoyi.rulengine.handler;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.iotcommon.domain.dto.DeviceCmdDTO;
import com.ruoyi.rulengine.domain.RuleAction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class DeviceCmdActionHandler implements RuleActionHandler{
    @Override
    public RuleAction execute(RuleAction ruleAction) {
        DeviceCmdDTO deviceCmdDTO = JSON.parseObject(ruleAction.getParams(), DeviceCmdDTO.class);
        log.info("DeviceCmdActionHandler: deviceCmdDTO=" + JSON.toJSONString(ruleAction.getParams()));
        return ruleAction;
    }
}
